package vn.fsoft.gst.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import vn.fsoft.gst.dao.UserDAO;
import vn.fsoft.gst.domain.User;

/**
 * This class implement UserService interface
 * 
 * @author TienNM
 *
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDAO userDao;

    @Transactional
    public int addUser(User user) {
        return userDao.addUser(user);
    }

    @Transactional
    public List<User> findAll() {
        return userDao.getListUser();
    }

    @Transactional
    public User getUserById(int Id) {
        return userDao.getUserById(Id);
    }
}
